<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>VIEW JOBS</title>
</head>
<body>
<%@page import="wildlife.*,java.sql.*" %>
<%
Connect c=new Connect();
String username=session.getAttribute("username").toString();
ResultSet rs=c.getResult("select * from jobs");

while(rs.next()){
	int jobid=rs.getInt("jobid");
	Connect c1=new Connect();
	ResultSet rs1=c.getResult("select * from jobappliers where jobid='"+jobid+"'");
	
	if(rs1.next()){
	String applier=rs1.getString("applier");
	String ngoname=rs.getString("username");
	if(applier.equals(username)){}
	else{
	String summary=rs.getString("summary");
	%>
	<s:form action="uploadresume.action" method="post" enctype="multipart/form-data" theme="simple">
	<input type="hidden" name="jobid" value=<%= jobid%> />
	<%= ngoname %>:<%= summary %><br>
	<s:file name="resume" label="Resume" />
	<s:submit value="Upload" align="center" />
</s:form>
<%
}
	}
	else{
		String ngoname=rs.getString("username");
		
		String summary=rs.getString("summary");
		%>
		<s:form action="uploadresume.action" method="post" enctype="multipart/form-data" theme="simple">
		<input type="hidden" name="jobid" value=<%= jobid%> />
		<%= ngoname %>:<%= summary %><br>
		<s:file name="resume" label="Resume" />
		<s:submit value="Upload" align="center" />
	</s:form>
	<%
	}
}
%>
</body>
</html>